/*
 * BatchModeHandler.h
 *
 *  Created on: Oct 26, 2011
 *      Author: zwx
 */

#include "../Include/includes.h"
#ifndef BATCHMODEHANDLER_H_
#define BATCHMODEHANDLER_H_
using namespace std;

struct input_file_tags{
	string number;
	string query;
};

class BatchModeHandler {
private:
	static const int MAX_LINE_SIZE = 8192;
public:
	BatchModeHandler();
	virtual ~BatchModeHandler();
	void handle(int model, int zone);
	int extract_zone(char* tag, char* text, char* query);
	void output(list<struct doc>* vec,  fstream& out, string query_no);
	void get_output_path(int mode, char* path);
	void get_tag(int zone, char* tag);
	int str_prefix_cmp(char* a, char* b);
	void extract_query(list<struct input_file_tags>* query, char* tag);
	void get_number_in_line(char* line, string& num);
	void get_title(char* line, string& title);
};

#endif /* BATCHMODEHANDLER_H_ */
